<?php

/*********************************************************************************/
/* CNB Your Account: An Advanced User Management System for phpnuke     		*/
/* ============================================                         		*/
/*                                                                      		*/
/* Copyright (c) 2004 by Comunidade PHP Nuke Brasil                     		*/
/* http://dev.phpnuke.org.br & http://www.phpnuke.org.br                		*/
/*                                                                      		*/
/* Contact author: escudero@phpnuke.org.br                              		*/
/* International Support Forum: http://ravenphpscripts.com/forum76.html 		*/
/*                                                                      		*/
/* This program is free software. You can redistribute it and/or modify 		*/
/* it under the terms of the GNU General Public License as published by 		*/
/* the Free Software Foundation; either version 2 of the License.       		*/
/*                                                                      		*/
/*********************************************************************************/
/* CNB Your Account it the official successor of NSN Your Account by Bob Marion	*/
/*********************************************************************************/
define('NO_EDITOR', true);
$advanced_editor = 0;
if (!defined('YA_ADMIN')) { echo "CNBYA admin protection"; exit; }
if (!eregi("modules.php", $_SERVER['SCRIPT_NAME'])) {
    header("Location: ../../../index.php");
    die ();
}
if (!defined('CNBYA')) { echo "CNBYA protection"; exit; }
if (($radminsuper==1) OR ($radminuser==1)) {

    $pagetitle = ": "._USERSCONFIG;
    include("header.php");
    title(_USERSCONFIG);
    amain();
    echo "<br>\n";
    OpenTable();
    echo "<center><table border='0' cellpadding='2' cellspacing='2'>\n";
    echo "<form action='modules.php?name=$module_name&file=admin' method='post'>\n";
    echo "<tr><td align='center' bgcolor='$bgcolor3' colspan='2'><b>"._YA_REGOPTIONS."</b></td></tr>\n";
    echo "<tr><td align='right' bgcolor='$bgcolor2'>"._ACTALLOWREG."</td>\n<td>";
    if ($ya_config['allowuserreg']==0) { $ck1 = " checked"; $ck2 = ""; } else { $ck1 = ""; $ck2 = " checked"; }
    echo "<input type='radio' name='xallowuserreg' value='0'$ck1>"._YES." &nbsp;";
    echo "<input type='radio' name='xallowuserreg' value='1'$ck2>"._NO."</td></tr>\n";
    echo "<tr><td align='right' bgcolor='$bgcolor2'>"._TELCONTROL."</td>\n<td>";
    if ($ya_config['telcontrol']==0) { $ck1 = " checked"; $ck2 = ""; } else { $ck1 = ""; $ck2 = " checked"; }
    echo "<input type='radio' name='xtelcontrol' value='0'$ck1>"._YES." &nbsp;";
    echo "<input type='radio' name='xtelcontrol' value='1'$ck2>"._NO."</td></tr>\n";
    echo "<tr><td align='right' bgcolor='$bgcolor2'>"._CITYCONTROL."</td>\n<td>";
    if ($ya_config['citycontrol']==0) { $ck1 = " checked"; $ck2 = ""; } else { $ck1 = ""; $ck2 = " checked"; }
    echo "<input type='radio' name='xcitycontrol' value='0'$ck1>"._YES." &nbsp;";
    echo "<input type='radio' name='xcitycontrol' value='1'$ck2>"._NO."</td></tr>\n";
    echo "<tr><td align='right' bgcolor='$bgcolor2'>"._MESLEKCONTROL."</td>\n<td>";
    if ($ya_config['meslekcontrol']==0) { $ck1 = " checked"; $ck2 = ""; } else { $ck1 = ""; $ck2 = " checked"; }
    echo "<input type='radio' name='xmeslekcontrol' value='0'$ck1>"._YES." &nbsp;";
    echo "<input type='radio' name='xmeslekcontrol' value='1'$ck2>"._NO."</td></tr>\n";

    echo "<tr><td align='right' bgcolor='$bgcolor2'>"._ULKECONTROL."</td>\n<td>";
    if ($ya_config['ulkecontrol']==0) { $ck1 = " checked"; $ck2 = ""; } else { $ck1 = ""; $ck2 = " checked"; }
    echo "<input type='radio' name='xulkecontrol' value='0'$ck1>"._YES." &nbsp;";
    echo "<input type='radio' name='xulkecontrol' value='1'$ck2>"._NO."</td></tr>\n";

    echo "<tr><td align='right' bgcolor='$bgcolor2'>"._REQUIREADMIN."</td>\n<td>";
    if ($ya_config['requireadmin']==0) { $ck1 = ""; $ck2 = " checked"; } else { $ck1 = " checked"; $ck2 = ""; }
    echo "<input type='radio' name='xrequireadmin' value='1'$ck1>"._YES." &nbsp;";
    echo "<input type='radio' name='xrequireadmin' value='0'$ck2>"._NO."</td></tr>\n";
    echo "<tr><td align='right' bgcolor='$bgcolor2'>"._ACTALLOWDELETE."</td>\n<td>";
    if ($ya_config['allowuserdelete']==0) { $ck1 = ""; $ck2 = " checked"; } else { $ck1 = " checked"; $ck2 = ""; }
    echo "<input type='radio' name='xallowuserdelete' value='1'$ck1>"._YES." &nbsp;";
    echo "<input type='radio' name='xallowuserdelete' value='0'$ck2>"._NO."</td></tr>\n";

    echo "<tr><td align='right' bgcolor='$bgcolor2'>"._DOUBLECHECKEMAIL."</td>\n<td>";
    if ($ya_config['doublecheckemail']==0) { $ck1 = ""; $ck2 = " checked"; } else { $ck1 = " checked"; $ck2 = ""; }
    echo "<input type='radio' name='xdoublecheckemail' value='1'$ck1>"._YES." &nbsp;";
    echo "<input type='radio' name='xdoublecheckemail' value='0'$ck2>"._NO." &nbsp;("._DOUBLECHECKEMAILNOTE.")</td></tr>\n";

    echo "<tr><td align='right' bgcolor='$bgcolor2'>"._ACTIVATECOPPA."</td>\n<td>";
    if ($ya_config['coppa']==0) { $ck1 = ""; $ck2 = " checked"; } else { $ck1 = " checked"; $ck2 = ""; }
    echo "<input type='radio' name='xcoppa' value='1'$ck1>"._YES." &nbsp;";
    echo "<input type='radio' name='xcoppa' value='0'$ck2>"._NO." &nbsp;("._ACTIVATECOPPANOTE.")</td></tr>\n";
    echo "<tr><td align='right' bgcolor='$bgcolor2'>"._ACTIVATETOS."</td>\n<td>";
    if ($ya_config['tos']==0) { $ck1 = ""; $ck2 = " checked"; } else { $ck1 = " checked"; $ck2 = ""; }
    echo "<input type='radio' name='xtos' value='1'$ck1>"._YES." &nbsp;";
    echo "<input type='radio' name='xtos' value='0'$ck2>"._NO."  &nbsp;("._ACTIVATETOSNOTE.")</td></tr>\n";
    echo "<tr><td align='right' bgcolor='$bgcolor2'>"._ACTIVATETOSALL."</td>\n<td>";
    if ($ya_config['tosall']==0) { $ck1 = ""; $ck2 = " checked"; } else { $ck1 = " checked"; $ck2 = ""; }
    echo "<input type='radio' name='xtosall' value='1'$ck1>"._YES." &nbsp;";
    echo "<input type='radio' name='xtosall' value='0'$ck2>"._NO." &nbsp;("._ACTIVATETOSALLNOTE.")</td></tr>\n";

    echo "<tr><td align='center' colspan='2'>&nbsp;</td></tr>\n";

    echo "<tr><td align='center' bgcolor='$bgcolor3' colspan='2'><b>"._YA_MAILOPTIONS."</b></td></tr>\n";
    echo "<tr><td align='right' bgcolor='$bgcolor2'>"._SERVERMAIL."</td>\n<td>";
    if ($ya_config['servermail']==0) { $ck1 = " checked"; $ck2 = ""; } else { $ck1 = ""; $ck2 = " checked"; }
    echo "<input type='radio' name='xservermail' value='0'$ck1>"._YES." &nbsp;";
    echo "<input type='radio' name='xservermail' value='1'$ck2>"._NO."</td></tr>\n";
    echo "<tr><td align='right' bgcolor='$bgcolor2'>"._ACTNOTIFYADD."<br>"._YA_SERVERMAILNOTE."</td>\n<td>";
    if ($ya_config['sendaddmail']==0) { $ck1 = ""; $ck2 = " checked"; } else { $ck1 = " checked"; $ck2 = ""; }
    echo "<input type='radio' name='xsendaddmail' value='1'$ck1>"._YES." &nbsp;";
    echo "<input type='radio' name='xsendaddmail' value='0'$ck2>"._NO."</td></tr>\n";
    echo "<tr><td align='right' bgcolor='$bgcolor2'>"._ACTNOTIFYDELETE."<br>"._YA_SERVERMAILNOTE."</td>\n<td>";
    if ($ya_config['senddeletemail']==0) { $ck1 = ""; $ck2 = " checked"; } else { $ck1 = " checked"; $ck2 = ""; }
    echo "<input type='radio' name='xsenddeletemail' value='1'$ck1>"._YES." &nbsp;";
    echo "<input type='radio' name='xsenddeletemail' value='0'$ck2>"._NO."</td></tr>\n";
    echo "<tr><td align='right' bgcolor='$bgcolor2'>"._USEACTIVATE."<br>"._YA_SERVERMAILNOTE."</td>\n<td>";
    if ($ya_config['useactivate']==0) { $ck1 = " checked"; $ck2 = ""; } else { $ck1 = ""; $ck2 = " checked"; }
    echo "<input type='radio' name='xuseactivate' value='0'$ck1>"._YES." &nbsp;";
    echo "<input type='radio' name='xuseactivate' value='1'$ck2>"._NO."</td></tr>\n";
    echo "<tr><td align='right' bgcolor='$bgcolor2'>"._ACTALLOWMAIL."</td>\n<td>";
    if ($ya_config['allowmailchange']==0) { $ck1 = " checked"; $ck2 = ""; } else { $ck1 = ""; $ck2 = " checked"; }
    echo "<input type='radio' name='xallowmailchange' value='0'$ck1>"._YES." &nbsp;";
    echo "<input type='radio' name='xallowmailchange' value='1'$ck2>"._NO."</td></tr>\n";
    echo "<tr><td align='right' bgcolor='$bgcolor2'>"._EMAILVALIDATE."<br>"._YA_SERVERMAILNOTE."</td>\n<td>";
    if ($ya_config['emailvalidate']==1) { $ck1 = " checked"; $ck2 = ""; } else { $ck1 = ""; $ck2 = " checked"; }
    echo "<input type='radio' name='xemailvalidate' value='1'$ck1>"._YES." &nbsp;";
    echo "<input type='radio' name='xemailvalidate' value='0'$ck2>"._NO."</td></tr>\n";

	
	
	
	echo "<tr><td align='right' bgcolor='$bgcolor2'>"._AFFICHEBONMEL."<br>"._AFFICHEBONMEL_EXPLI."</td>\n<td>";
    if ($ya_config['affichebonmel']==1) { $ck1 = " checked"; $ck2 = ""; } else { $ck1 = ""; $ck2 = " checked"; }
    echo "<input type='radio' name='xaffichebonmel' value='1'$ck1>"._YES." &nbsp;";
    echo "<input type='radio' name='xaffichebonmel' value='0'$ck2>"._NO."</td></tr>\n";

	echo "<tr><td align='right' bgcolor='$bgcolor2'>"._AFFICHEMAUVAISMEL."<br>"._AFFICHEMAUVAISMEL_EXPLI."</td>\n<td>";
    if ($ya_config['affichemauvaismel']==1) { $ck1 = " checked"; $ck2 = ""; } else { $ck1 = ""; $ck2 = " checked"; }
    echo "<input type='radio' name='xaffichemauvaismel' value='1'$ck1>"._YES." &nbsp;";
    echo "<input type='radio' name='xaffichemauvaismel' value='0'$ck2>"._NO."</td></tr>\n";
    echo "<tr><td align='center' colspan='2'>&nbsp;</td></tr>\n";
	
    echo "<tr><td align='center' bgcolor='$bgcolor3' colspan='2'><b>"._YA_GRAPOPTIONS."</b></td></tr>\n";
    echo "<tr><td align='right' bgcolor='$bgcolor2'>"._ACTALLOWTHEME."</td>\n<td>";
    if ($ya_config['allowusertheme']==0) { $ck1 = " checked"; $ck2 = ""; } else { $ck1 = ""; $ck2 = " checked"; }
    echo "<input type='radio' name='xallowusertheme' value='0'$ck1>"._YES." &nbsp;";
    echo "<input type='radio' name='xallowusertheme' value='1'$ck2>"._NO."</td></tr>\n";
    
    if (extension_loaded("gd")) {
		echo "<tr><td align='right' bgcolor='$bgcolor2' valign='top'>"._USEGFXCHECK."</td>\n";
        $ck0 = $ck1 = $ck2 = $ck3 = "";
        if ($ya_config['usegfxcheck']==0) { $ck0 = " checked"; } elseif ($ya_config['usegfxcheck']==1) { $ck1 = " checked"; } elseif ($ya_config['usegfxcheck']==2) { $ck2 = " checked"; } elseif ($ya_config['usegfxcheck']==3) { $ck3 = " checked"; }
        echo "<td><input type='radio' name='xusegfxcheck' value='0'$ck0>"._YA_NC."<br>\n";
        echo "<input type='radio' name='xusegfxcheck' value='1'$ck1>"._YA_RC."<br>\n";
        echo "<input type='radio' name='xusegfxcheck' value='2'$ck2>"._YA_LC."<br>\n";
        echo "<input type='radio' name='xusegfxcheck' value='3'$ck3>"._YA_CA."</td>";
		echo "</tr>\n";
		echo "<tr><td align='right' bgcolor='$bgcolor2' valign='top'>"._YA_CODESIZE."</td><td><select name='xcodesize'>\n";
    	for ($ss = 1; $ss <= 10; $ss++) {echo "<option value = $ss "; if ($ya_config['codesize'] == "$ss") { echo " selected"; }	echo ">$ss</option>\n";}
    } else {
		echo "<tr><td align='right' bgcolor='$bgcolor2' valign='top'>"._USEGFXCHECK."</td>\n";
        echo "<td><input type='hidden' name='xusegfxcheck' value='0'>"._YA_GD."</td>";
		echo "</tr>\n";
    }
    
    echo "<tr><td align='center' colspan='2'>&nbsp;</td></tr>\n";
    echo "<tr><td align='center' bgcolor='$bgcolor3' colspan='2'><b>"._YA_EXPOPTIONS."</b></td></tr>\n";
    echo "<tr><td align='right' bgcolor='$bgcolor2' valign='top'>"._AUTOSUSPEND."</td><td><select name='xautosuspend'>\n";
    echo "<option value='0'";
    if ($ya_config['autosuspend'] == 0) { echo " selected"; }
    echo ">0 "._YA_NONEXPIRE."</option>\n";
    $i = 1;
    while ($i <= 52) {
        $k = $i * 604800;
        echo "<option value='$k'";
        if ($ya_config['autosuspend'] == $k) { echo " selected"; }
        echo">$i ";
        if ($i == 1) { echo _YA_WEEK; } else { echo _YA_WEEKS; }
        echo "</option>\n";
        $i++;
    }
    echo "</select><br>("._AUTOSUSNOTE.")</td></tr>\n";
    echo "<tr><td align='right' bgcolor='$bgcolor2' valign='top'>"._YA_EXPIRING."</td><td><select name='xexpiring'>\n";
    echo "<option value='0'";
    if ($ya_config['expiring'] == 0) { echo " selected"; }
    echo ">0 "._YA_NONEXPIRE."</option>\n";
    $i = 1;
    while ($i <= 30) {
        $k = $i * 86400;
        echo "<option value='$k'";
        if ($ya_config['expiring'] == $k) { echo " selected"; }
        echo">$i ";
        if ($i == 1) { echo _YA_DAY; } else { echo _YA_DAYS; }
        echo "</option>\n";
        $i++;
    }
    echo "</select><br>("._YA_EXPIRINGNOTE.")</td></tr>\n";
    echo "<tr><td align='right' bgcolor='$bgcolor2'>"._AUTOSUSPENDMAIN."<br>("._YA_AUTOSUSPENDMAINNOTE.")</td>\n<td>";
    if ($ya_config['autosuspendmain']==1) { $ck1 = " checked"; $ck2 = ""; } else { $ck1 = ""; $ck2 = " checked"; }
    echo "<input type='radio' name='xautosuspendmain' value='1'$ck1>"._YES." &nbsp;";
    echo "<input type='radio' name='xautosuspendmain' value='0'$ck2>"._NO."</td></tr>\n";
    echo "<tr><td align='center' colspan='2'>&nbsp;</td></tr>\n";

    echo "<tr><td align='center' bgcolor='$bgcolor3' colspan='2'><b>"._YA_LMTOPTIONS."</b></td></tr>\n";
    echo "<tr><td align='right' bgcolor='$bgcolor2' valign='top'>"._YA_PERPAGE."</td><td><select name='xperpage'>\n";
    $i = 1;
    while ($i <= 10) {
        $k = $i * 50;
        echo "<option value='$k'";
        if ($ya_config['perpage'] == $k) { echo " selected"; }
        echo">$k "._YA_USERS."</option>\n";
        $i++;
    }
    echo "</select><br>("._YA_PERPAGENOTE.")</td></tr>\n";
    echo "<tr><td align='right' bgcolor='$bgcolor2' valign='top'>"._YA_BADNICK.":</td><td><textarea name='xbad_nick' rows='5' cols='40'>".$ya_config['bad_nick']."</textarea><br>"._YA_1PERLINE."</td><td>\n";
    echo "<tr><td align='right' bgcolor='$bgcolor2' valign='top'>"._YA_BADMAIL.":</td><td><textarea name='xbad_mail' rows='5' cols='40'>".$ya_config['bad_mail']."</textarea><br>"._YA_1PERLINE."</td><td>\n";
    echo "<tr><td align='right' bgcolor='$bgcolor2' valign='top'>"._YA_BONMAIL.":</td><td><textarea name='xbon_mail' rows='5' cols='40'>".$ya_config['bon_mel']."</textarea><br>"._YA_1PERLINE."</td><td>\n";
    echo "<tr><td align='right' bgcolor='$bgcolor2' valign='top'>"._YA_NICKMIN.":</td><td><select name='xnick_min'>\n";
    for ($i = 3; $i <= 24; $i++) {
        echo "<option value='$i'";
        if ($ya_config['nick_min'] == $i) { echo " selected"; }
        echo">$i "._YA_CHARS."</option>\n";
    }
    echo "</select></td></tr>\n";
/*
echo "<tr><td bgcolor='$bgcolor2'><b>"._CITYLIST.":</b></td><td><select name='chng_city_id'>\n";

$row = $db->sql_fetchrow($db->sql_query("SELECT sehir_id, sehir_adi FROM ".$prefix."_cnbya_sehir"));
$result = mysql_query ($row);
echo "<option $sel value=''>"._SECINIZ."</option>\n";
while($row = $db->sql_fetchrow($result)) {
  $sehir_id = $row['sehir_id'];
  $sehir_adi = $row['sehir_adi'];
  if($sehir_id == $sehir_id) { $sel = "selected "; }
  echo "<option value='$sehir_adi'>$sehir_adi</option>\n";
  $sel = "";
}
}
*/
    echo "<tr><td align='right' bgcolor='$bgcolor2' valign='top'>"._YA_NICKMAX.":</td><td><select name='xnick_max'>\n";
    for ($i = 4; $i <= 25; $i++) {
        echo "<option value='$i'";
        if ($ya_config['nick_max'] == $i) { echo " selected"; }
        echo">$i "._YA_CHARS."</option>\n";
    }
    echo "</select></td></tr>\n";
    echo "<tr><td align='right' bgcolor='$bgcolor2' valign='top'>"._YA_PASSMIN.":</td><td><select name='xpass_min'>\n";
    for ($i = 3; $i <= 24; $i++) {
        echo "<option value='$i'";
        if ($ya_config['pass_min'] == $i) { echo " selected"; }
        echo">$i "._YA_CHARS."</option>\n";
    }
    echo "</select></td></tr>\n";
    echo "<tr><td align='right' bgcolor='$bgcolor2' valign='top'>"._YA_PASSMAX.":</td><td><select name='xpass_max'>\n";
    for ($i = 4; $i <= 25; $i++) {
        echo "<option value='$i'";
        if ($ya_config['pass_max'] == $i) { echo " selected"; }
        echo">$i "._YA_CHARS."</option>\n";
    }
    echo "</select></td></tr>\n";
    echo "<input type='hidden' name='op' value='UsersConfigSave'>";
    echo "<tr><td align='center' colspan='2'>&nbsp;</td></tr>\n";
    echo "<tr><td align='center' colspan='2'><input type='submit' value='"._SAVECHANGES."'></td></tr>";
    echo "</form></table></center>";
    CloseTable();
    include("footer.php");

}

?>